#ifndef VEHICLE_MAP_DATA_PROVIDER_H_
#define VEHICLE_MAP_DATA_PROVIDER_H_
#include <math.h>
#include <mutex>
#include <thread>
#include <vector>
#include <map>
#include "common/macro.h"
#include "common/common.h"
#include "common/utils.h"
#include "math/gps_linearize.h"
#include "lcmtypes/vehicle_status_t.hpp"
#include "lcmtypes/gps_imu_info_t.hpp"
#include "lcmtypes/map_info_t.hpp"

namespace vehicle {
namespace map {

class DataProviderConfig
{
public:
 ~DataProviderConfig() = default;
  DataProviderConfig() = default;
 bool Update(ConfigInfo &config_info );
 ConfigInfo const config_info();

private:
 mutable std::mutex mutex_;
 ConfigInfo config_info_;
 DECLARE_SINGLETON_WITHOUT_CONSTRUCTOR(DataProviderConfig);
};

//class DataProviderFencePoints
//{
//public:
// ~DataProviderFencePoints() = default;
//  DataProviderFencePoints() = default;
// bool Update(std::vector<STRoadPoint> &fence_points_info );
// std::vector<STRoadPoint> const fence_points_info();
// bool reset_fence_points_info();

//private:
// mutable std::mutex mutex_;
// std::vector<STRoadPoint> fence_points_info_;
// DECLARE_SINGLETON_WITHOUT_CONSTRUCTOR(DataProviderFencePoints);
//};


//class DataProviderRoadPoints
//{
//public:
// ~DataProviderRoadPoints() = default;
//  DataProviderRoadPoints() = default;
// bool Update(std::vector<STRoadPoint> &road_points );
// std::vector<STRoadPoint> const road_points();

//private:
// mutable std::mutex mutex_;
// std::vector<STRoadPoint> road_points_;
// DECLARE_SINGLETON_WITHOUT_CONSTRUCTOR(DataProviderRoadPoints);
//};


//class DataProviderGPSPoints
//{
//public:
// ~DataProviderGPSPoints() = default;
//  DataProviderGPSPoints() = default;
// bool Update(STRoadPoints &gps_points );
// STRoadPoints const gps_points();

//private:
// mutable std::mutex mutex_;
// STRoadPoints gps_points_;
// DECLARE_SINGLETON_WITHOUT_CONSTRUCTOR(DataProviderGPSPoints);
//};

class DataProviderMapInfoPoints
{
public:
 ~DataProviderMapInfoPoints() = default;
  DataProviderMapInfoPoints() = default;
 bool Update(std::map<int, SetofMapInfo> &map_info_points );
 std::map<int, SetofMapInfo> const map_info_points();

private:
 mutable std::mutex mutex_;
 std::map<int, SetofMapInfo> map_info_points_;
 DECLARE_SINGLETON_WITHOUT_CONSTRUCTOR(DataProviderMapInfoPoints);
};

class DataProviderSetofMapInfo
{
public:
 ~DataProviderSetofMapInfo() = default;
  DataProviderSetofMapInfo() = default;
 bool Update(SetofMapInfo &set_of_map_info);
 SetofMapInfo const set_of_map_info();

private:
 mutable std::mutex mutex_;
 SetofMapInfo set_of_map_info_;
 DECLARE_SINGLETON_WITHOUT_CONSTRUCTOR(DataProviderSetofMapInfo);
};


class DataProviderEgoPosition
{
public:
 ~DataProviderEgoPosition() = default;
  DataProviderEgoPosition() = default;
 bool Update(STRoadPoint &ego_position );
 STRoadPoint const ego_position();

private:
 mutable std::mutex mutex_;
 STRoadPoint ego_position_;
 DECLARE_SINGLETON_WITHOUT_CONSTRUCTOR(DataProviderEgoPosition);
};

class DataProviderEgoPath
{
public:
 ~DataProviderEgoPath() = default;
  DataProviderEgoPath() = default;
 bool Update(std::vector<STRoadPoint> &ego_path );
 std::vector<STRoadPoint> const ego_path();

private:
 mutable std::mutex mutex_;
 std::vector<STRoadPoint> ego_path_;
 DECLARE_SINGLETON_WITHOUT_CONSTRUCTOR(DataProviderEgoPath);
};

class DataProviderMapInfo{
public:
 ~DataProviderMapInfo() = default;
    DataProviderMapInfo() = default;
 bool Update(lcmtypes::map_info_t &map_info);
lcmtypes::map_info_t const MapInfo();

private:
 mutable std::mutex mutex_;
 lcmtypes::map_info_t map_info_;
 DECLARE_SINGLETON_WITHOUT_CONSTRUCTOR(DataProviderMapInfo);
};


class DataProviderVehicleStatusInfo{
public:
 ~DataProviderVehicleStatusInfo() = default;
    DataProviderVehicleStatusInfo() = default;
 bool Update(lcmtypes::vehicle_status_t &vehicle_status );
 lcmtypes::vehicle_status_t const VehicleStatus();

private:
 mutable std::mutex mutex_;
 lcmtypes::vehicle_status_t vehicle_status_;
 DECLARE_SINGLETON_WITHOUT_CONSTRUCTOR(DataProviderVehicleStatusInfo);
};

class DataProviderGPSIMUInfo{
public:
 ~DataProviderGPSIMUInfo() = default;
    DataProviderGPSIMUInfo() = default;
 bool Update(lcmtypes::gps_imu_info_t &gps_imu_info );
 lcmtypes::gps_imu_info_t  GpsImuInfo();

private:
 mutable std::mutex mutex_;
 lcmtypes::gps_imu_info_t gps_imu_info_;
 DECLARE_SINGLETON_WITHOUT_CONSTRUCTOR(DataProviderGPSIMUInfo);
};



}
}

#endif
